#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>	
struct patient
{
	char name[10];
	float temperature;
	int kesou;
	int zhuangtai;
}m[205];

int panduan(int i)
{
	if (m[i].temperature >= 37.5 && m[i].kesou ==1)
	{
		return 1;
	}
	else
	{
		return 0;
	}
	
}

int main()
{
	int n = 0, i = 0;
	scanf("%d", &n);
	int cnt = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%s %f %d", &m[i].name, &m[i].temperature, &m[i].kesou);
		m[i].zhuangtai = 0;
	}
	for (i = 0; i < n; i++)
	{
		m[i].zhuangtai = panduan(i);
		if (m[i].zhuangtai == 1)
		{
			printf("%s\n", m[i].name);
			cnt++;
		}
		

	}
	printf("%d", cnt);
	
	return 0;
}
